/*
 * timing.h
 *
 *  Created on: Sep 18, 2013
 *      Author: hugoyamamura
 */

#ifndef TIMING_H_
#define TIMING_H_

#include <sys/time.h>
#include <stdlib.h>
#include <stdio.h>


// From http://stackoverflow.com/questions/1468596/c-programming-calculate-elapsed-time-in-milliseconds-unix
//Captures the time;
//return 0 if success
int getTime(struct timeval *t);

//Calculate the microsecs that elapsed in a process
int timeval_subtract(struct timeval *result, struct timeval *t2, struct timeval *t1);

//Printf the value
void timeval_print(struct timeval *tv);

//Print the elapsed time
void elapsed(struct timeval elapsed);
